﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace 战地2服务器控制中心
{

    public partial class 服务器设置 : Form
    {
        string QJPTK;
        string QJPD;
        string QJFF;
        string NoZaiju;
        string mode = null;
        public 服务器设置()
        {
            //File.Exists(@"BF2.exe")
            //通过C#中的泛型来记录
            //var lines = File.ReadAllLines(@"mods\bf2\Settings\ServerSettings.con");
            //string str = lines[2];
            //this.ServerNameBox.Text = read;
            //content[0] = "sv.serverName \"* BF-LaoWanJia 1# BuZhan Server HERO COVERT ONER ONCE SHA...	\"";
            //System.IO.File.WriteAllText("I:\\Battlefield 2 Server\\mods\\bf2\\settings\\ServerSettings.con", string.Join("\r\n", content));
            //System.Diagnostics.Process.Start("bf2_w32ded.exe");
            //System.Threading.Thread.Sleep(1000);
            //StreamReader s = File.OpenText(@"mods\bf2\settings\ServerSettings.con"); //要打开的文本文件，如果跟程序不在一个目录，要包括路径
            //string read1 = s.ReadLine();//读取一行，存放在变量read中
            //ServerNameBox.Text = read1;
            //string read2 = s.ReadLine();//读取一行，存放在变量read中
            //ServerPasswordBox.Text =read2;
            InitializeComponent();//初始化所有控件
            mode = SupportMode.Mode;
            try
            {
                //读取服务器名
                var lines = File.ReadAllLines(@"mods\" + mode + @"\settings\ServerSettings.con");//读取服务器设置（然后通过下标来指定一行）
                string _SN = lines[0];//下标第一行
                string SN = _SN.Substring(14);//截断之前的字符串
                char[] FGSN = { '"' };//分割引号
                string[] SNs = SN.Split(FGSN, StringSplitOptions.RemoveEmptyEntries);//实行分割并且把他转成字符串数组
                StringBuilder sb = new StringBuilder();//实例化
                for (int i = 0; i < SNs.Length; i++)//把字符串数组转换为字符串
                {
                    sb.Append(SNs[i]);
                }
                SN = sb.ToString();//重新赋值给SN
                ServerNameBox.Text = SN;
                //读取服务器欢迎信息
                string _WL = lines[5];
                string WL = _WL.Substring(18);
                char[] FGWL = { '"' };
                string[] WLs = WL.Split(FGWL, StringSplitOptions.RemoveEmptyEntries);
                StringBuilder sx = new StringBuilder();
                for (int i = 0; i < WLs.Length; i++)
                {
                    sx.Append(WLs[i]);
                }
                WL = sx.ToString();
                ServerWelcomeBox.Text = WL;
                //读取服务器端口
                string _SDK = lines[4];
                string SDK = _SDK.Substring(14);
                ServerPortBox.Value = Convert.ToDecimal(SDK);
                //读取回合地图数
                string _RMAP = lines[20];
                string RMAP = _RMAP.Substring(16);
                RoundsPerMapBox.Value = Convert.ToDecimal(RMAP);
                //读取最大玩家数
                string _MaxPlayer = lines[11];
                string MaxPlayer = _MaxPlayer.Substring(14);
                MaxPlayersBar.Value = Convert.ToInt32(MaxPlayer);
                MaxPlayersBox.Text = MaxPlayersBar.Value.ToString();
                //读取开始需要的玩家数量
                string _Stats = lines[12];
                string Stats = _Stats.Substring(27);
                PlayersToStartSlider.Value = Convert.ToInt32(Stats);
                PlayersToStartValueBox.Text = PlayersToStartSlider.Value.ToString();
                //读取服务器兵力值
                string _BLZ = lines[19];
                string BLZ = _BLZ.Substring(15);
                TicketRatioBar.Value = Convert.ToInt32(BLZ);
                TicketRatioBox.Text = TicketRatioBar.Value.ToString();
                //读取服务器一局时间
                string _Ztime = lines[21];
                string Ztime = _Ztime.Substring(13);
                TimeLimitBar.Value = Convert.ToInt32(Ztime);
                TimeLimitBox.Text = Ztime;
                //读取重生时间
                string _Ctime = lines[16];
                string Ctime = _Ctime.Substring(13);
                SpawnTimeBar.Value = Convert.ToInt32(Ctime);
                SpawnTimeBox.Text = Ctime;
                //读取玩家等待被救起的时间
                string _Jtime = lines[17];
                string Jtime = _Jtime.Substring(15);
                ManDownBar.Value = Convert.ToInt32(Jtime);
                ManDownBox.Text = Jtime;
                //读取友军开火伤害
                string _SFF = lines[23];
                string SFF = _SFF.Substring(23);
                SoldierFFBar.Value = Convert.ToInt32(SFF);
                SoldierFFBox.Text = SFF;
                //读取友军溅射伤害
                string _SSFF = lines[25];
                string SSFF = _SSFF.Substring(29);
                SoldierSplashFFBar.Value = Convert.ToInt32(SSFF);
                SoldierSplashFFBox.Text = SSFF;
                //读取友军载具伤害
                string _VFF = lines[24];
                string VFF = _VFF.Substring(23);
                VehicleFFBar.Value = Convert.ToInt32(VFF);
                VehicleFFBox.Text = VFF;
                //读取友军载具溅射伤害
                string _VSFF = lines[26];
                string VSFF = _VSFF.Substring(29);
                VehicleSplashFFBar.Value = Convert.ToInt32(VSFF);
                VehicleSplashFFBox.Text = VSFF;
                //读取杀害友军惩罚开关
                string _PTK = lines[27];
                string PTK = _PTK.Substring(19);
                if (PTK == "1")
                {
                    PunishTeamKillsBox.Checked = true;
                }
                else
                {
                    PunishTeamKillsBox.Checked = false;
                }
                //读取默认惩罚
                string _PD = lines[29];
                string PD = _PD.Substring(21);
                if (PD == "1")
                {
                    PunishDefaultBox.Checked = true;
                }

                else
                {
                    PunishDefaultBox.Checked = false;
                }
                //读取友军地雷
                string _FF = lines[62];
                string FF = _FF.Substring(25);
                if (FF == "1")
                {
                    FriendlyFireBox.Checked = true;
                }
                else
                {
                    FriendlyFireBox.Checked = false;
                }
                //读取杀害友军提出
                string _TBK = lines[28];
                string TBK = _TBK.Substring(21);
                TksBeforeKickBox.Value = Convert.ToDecimal(TBK);
                //读取无载具设置
                string _NoZJ = lines[67];
                string NOZJ = _NoZJ.Substring(14);
                if (NOZJ == "1")
                {
                    NoVehicles.Checked = true;
                }
                else
                {
                    NoVehicles.Checked = false;
                }
            }
            catch
            {
                DialogResult dr = MessageBox.Show("检测到你的服务器设置文件不完整，无法打开，可以帮你恢复为默认设置，现在要恢复吗？", "文件不完整警告", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
                if (dr == DialogResult.OK)
                {
                    StreamWriter sw = new StreamWriter(@"mods\" + mode + @"\Settings\ServerSettings.con");//写入服务器设置文件
                    sw.WriteLine("sv.serverName \"Default Server Name\"" + "\n" + "sv.password \"\"" + "\n" + "sv.internet 1" + "\n" + "sv.serverIP \"0.0.0.0\"" + "\n" + "sv.serverPort 16567"
                        + "\n" + "sv.welcomeMessage \"WelCome to Default Server Name\"" + "\n" + "sv.punkBuster 1" + "\n" + "sv.allowFreeCam 1" + "\n" + "sv.allowExternalViews 1" + "\n" + "sv.allowNoseCam 1" + "\n" + "sv.hitIndicator 1"
                        + "\n" + "sv.maxPlayers 40" + "\n" + "sv.numPlayersNeededToStart 2" + "\n" + "sv.notEnoughPlayersRestartDelay 15" + "\n" + "sv.startDelay 15" + "\n" + "sv.endDelay 15"
                        + "\n" + "sv.spawnTime 8" + "\n" + "sv.manDownTime 8" + "\n" + "sv.endOfRoundDelay 15" + "\n" + "sv.ticketRatio 980" + "\n" + "sv.roundsPerMap 1" + "\n" + "sv.timeLimit 2700"
                        + "\n" + "sv.scoreLimit 0" + "\n" + "sv.soldierFriendlyFire 0" + "\n" + "sv.vehicleFriendlyFire 0" + "\n" + "sv.soldierSplashFriendlyFire 0" + "\n" + "sv.vehicleSplashFriendlyFire 0"
                        + "\n" + "sv.tkPunishEnabled 1" + "\n" + "sv.tkNumPunishToKick 3" + "\n" + "sv.tkPunishByDefault 0" + "\n" + "sv.votingEnabled 1" + "\n" + "sv.voteTime 90"
                        + "\n" + "sv.minPlayersForVoting 2" + "\n" + "sv.gameSpyPort 29900" + "\n" + "sv.allowNATNegotiation 0" + "\n" + "sv.interfaceIP \"0.0.0.0\"" + "\n" + "sv.autoRecord 0"
                        + "\n" + "sv.demoIndexURL http://" + "\n" + "sv.demoDownloadURL http://" + "\n" + "sv.autoDemoHook \"adminutils/demo/rotate_demo.exe\"" + "\n" + "sv.demoQuality 1"
                        + "\n" + "sv.adminScript \"modmanager\"" + "\n" + "sv.timeBeforeRestartMap 30" + "\n" + "sv.autoBalanceTeam 1" + "\n" + "sv.teamRatioPercent 100" + "\n" + "sv.voipEnabled 1"
                        + "\n" + "sv.voipQuality 3" + "\n" + "sv.voipServerRemote 0" + "\n" + "sv.voipServerRemoteIP \"\"" + "\n" + "sv.voipServerPort 55125" + "\n" + "sv.voipBFClientPort 55123"
                        + "\n" + "sv.voipBFServerPort 55124" + "\n" + "sv.voipSharedPassword \"\"" + "\n" + "sv.useGlobalRank 1" + "\n" + "sv.useGlobalUnlocks 1" + "\n" + "sv.sponsorText \"\""
                        + "\n" + "sv.sponsorLogoURL \"http://bf2.ttitt.net/logo.jpg\"" + "\n" + "sv.communityLogoURL \"http://bf2.ttitt.net/logo.jpg\"" + "\n" + "sv.radioSpamInterval 6"
                        + "\n" + "sv.radioMaxSpamFlagCount 6" + "\n" + "sv.radioBlockedDurationTime 30" + "\n" + "sv.numReservedSlots 0" + "\n" + "sv.friendlyFireWithMines 0" + "\n" + "sv.coopBotCount 16"
                        + "\n" + "sv.coopBotDifficulty 50" + "\n" + "sv.coopBotRatio 50" + "\n" + "sv.teamVoteOnly 0" + "\n" + "sv.noVehicles 0");//所有的功能已经写入
                    sw.Close();//关闭流，才能写入文本
                    MessageBox.Show("恢复成功");
                    this.Close();
                }
                else
                {
                    Close();
                }
            }

        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            string ServerName = this.ServerNameBox.Text + "\"";
            string ServerWelcome = this.ServerWelcomeBox.Text + "\"";
            StreamWriter sw = new StreamWriter(@"mods\" + mode + @"\Settings\ServerSettings.con");//写入服务器设置文件
            sw.WriteLine("sv.serverName \"" + ServerName + "\n" + "sv.password \"\"" + "\n" + "sv.internet 1" + "\n" + "sv.serverIP \"0.0.0.0\"" + "\n" + "sv.serverPort " + ServerPortBox.Value
                + "\n" + "sv.welcomeMessage \"" + ServerWelcome + "\n" + "sv.punkBuster 1" + "\n" + "sv.allowFreeCam 1" + "\n" + "sv.allowExternalViews 1" + "\n" + "sv.allowNoseCam 1" + "\n" + "sv.hitIndicator 1"
                + "\n" + "sv.maxPlayers " + MaxPlayersBox.Text + "\n" + "sv.numPlayersNeededToStart " + PlayersToStartValueBox.Text + "\n" + "sv.notEnoughPlayersRestartDelay 15" + "\n" + "sv.startDelay 15" + "\n" + "sv.endDelay 15"
                + "\n" + "sv.spawnTime " + SpawnTimeBox.Text + "\n" + "sv.manDownTime " + ManDownBox.Text + "\n" + "sv.endOfRoundDelay 15" + "\n" + "sv.ticketRatio " + TicketRatioBox.Text + "\n" + "sv.roundsPerMap " + RoundsPerMapBox.Value + "\n" + "sv.timeLimit " + TimeLimitBox.Text
                + "\n" + "sv.scoreLimit 0" + "\n" + "sv.soldierFriendlyFire " + SoldierFFBox.Text + "\n" + "sv.vehicleFriendlyFire " + VehicleFFBox.Text + "\n" + "sv.soldierSplashFriendlyFire " + SoldierSplashFFBox.Text + "\n" + "sv.vehicleSplashFriendlyFire " + VehicleSplashFFBox.Text
                + "\n" + "sv.tkPunishEnabled " + QJPTK + "\n" + "sv.tkNumPunishToKick " + TksBeforeKickBox.Value + "\n" + "sv.tkPunishByDefault " + QJPD + "\n" + "sv.votingEnabled 1" + "\n" + "sv.voteTime 90"
                + "\n" + "sv.minPlayersForVoting 2" + "\n" + "sv.gameSpyPort 29900" + "\n" + "sv.allowNATNegotiation 0" + "\n" + "sv.interfaceIP \"0.0.0.0\"" + "\n" + "sv.autoRecord 0"
                + "\n" + "sv.demoIndexURL http://" + "\n" + "sv.demoDownloadURL http://" + "\n" + "sv.autoDemoHook \"adminutils/demo/rotate_demo.exe\"" + "\n" + "sv.demoQuality 1"
                + "\n" + "sv.adminScript \"modmanager\"" + "\n" + "sv.timeBeforeRestartMap 30" + "\n" + "sv.autoBalanceTeam 1" + "\n" + "sv.teamRatioPercent 100" + "\n" + "sv.voipEnabled 1"
                + "\n" + "sv.voipQuality 3" + "\n" + "sv.voipServerRemote 0" + "\n" + "sv.voipServerRemoteIP \"\"" + "\n" + "sv.voipServerPort 55125" + "\n" + "sv.voipBFClientPort 55123"
                + "\n" + "sv.voipBFServerPort 55124" + "\n" + "sv.voipSharedPassword \"\"" + "\n" + "sv.useGlobalRank 1" + "\n" + "sv.useGlobalUnlocks 1" + "\n" + "sv.sponsorText \"\""
                + "\n" + "sv.sponsorLogoURL \"http://bf2.ttitt.net/logo.jpg\"" + "\n" + "sv.communityLogoURL \"http://bf2.ttitt.net/logo.jpg\"" + "\n" + "sv.radioSpamInterval 6"
                + "\n" + "sv.radioMaxSpamFlagCount 6" + "\n" + "sv.radioBlockedDurationTime 30" + "\n" + "sv.numReservedSlots 0" + "\n" + "sv.friendlyFireWithMines " + QJFF + "\n" + "sv.coopBotCount 16"
                + "\n" + "sv.coopBotDifficulty 50" + "\n" + "sv.coopBotRatio 50" + "\n" + "sv.teamVoteOnly 0" + "\n" + "sv.noVehicles " + NoZaiju);//所有的服务器设置功能已经写入
            sw.Close();//关闭流，才能写入文本
            MessageBox.Show("保存成功");
            this.Close();
        }


        public string NameServerName { get; set; }

        private void PlayersToStartSlider_Scroll(object sender, EventArgs e)
        {
            PlayersToStartValueBox.Text = PlayersToStartSlider.Value.ToString();
        }

        private void MaxPlayersBar_Scroll(object sender, EventArgs e)
        {
            MaxPlayersBox.Text = MaxPlayersBar.Value.ToString();
        }

        private void TicketRatioBar_Scroll(object sender, EventArgs e)
        {
            TicketRatioBox.Text = TicketRatioBar.Value.ToString();
        }

        private void TimeLimitBar_Scroll(object sender, EventArgs e)
        {
            TimeLimitBox.Text = TimeLimitBar.Value.ToString();
        }

        private void SpawnTimeBar_Scroll(object sender, EventArgs e)
        {
            SpawnTimeBox.Text = SpawnTimeBar.Value.ToString();
        }

        private void ManDownBar_Scroll(object sender, EventArgs e)
        {
            ManDownBox.Text = ManDownBar.Value.ToString();
        }

        private void SoldierFFBar_Scroll(object sender, EventArgs e)
        {
            SoldierFFBox.Text = SoldierFFBar.Value.ToString();
        }

        private void SoldierSplashFFBar_Scroll(object sender, EventArgs e)
        {
            SoldierSplashFFBox.Text = SoldierSplashFFBar.Value.ToString();

        }

        private void VehicleFFBar_Scroll(object sender, EventArgs e)
        {
            VehicleFFBox.Text = VehicleFFBar.Value.ToString();
        }

        private void VehicleSplashFFBar_Scroll(object sender, EventArgs e)
        {
            VehicleSplashFFBox.Text = VehicleSplashFFBar.Value.ToString();
        }

        private void PunishTeamKillsBox_CheckedChanged(object sender, EventArgs e)
        {
            if (PunishTeamKillsBox.Checked == true)
            {
                QJPTK = "1";
            }
            else
            {
                QJPTK = "0";
            }
        }

        private void PunishDefaultBox_CheckedChanged(object sender, EventArgs e)
        {
            if (PunishDefaultBox.Checked == true)
            {
                QJPD = "1";
            }
            else
            {
                QJPD = "0";
            }
        }

        private void FriendlyFireBox_CheckedChanged(object sender, EventArgs e)
        {
            if (FriendlyFireBox.Checked == true)
            {
                QJFF = "1";
            }
            else
            {
                QJFF = "0";
            }
        }
        private void NoVehicles_CheckedChanged(object sender, EventArgs e)//点击无载具
        {
            if (NoVehicles.Checked == true)
            {
                NoZaiju = "1";
            }
            else
            {
                NoZaiju = "0";
            }
        }

        private void Reload_Click(object sender, EventArgs e)
        {
            DialogResult dr = MessageBox.Show("你确定要恢复默认吗？", "警告", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
            if (dr == DialogResult.OK)
            {
                StreamWriter sw = new StreamWriter(@"mods\" + mode + @"\Settings\ServerSettings.con");//写入服务器设置文件
                sw.WriteLine("sv.serverName \"Default Server Name\"" + "\n" + "sv.password \"\"" + "\n" + "sv.internet 1" + "\n" + "sv.serverIP \"0.0.0.0\"" + "\n" + "sv.serverPort 16567"
                    + "\n" + "sv.welcomeMessage \"WelCome to Default Server Name\"" + "\n" + "sv.punkBuster 1" + "\n" + "sv.allowFreeCam 1" + "\n" + "sv.allowExternalViews 1" + "\n" + "sv.allowNoseCam 1" + "\n" + "sv.hitIndicator 1"
                    + "\n" + "sv.maxPlayers 40" + "\n" + "sv.numPlayersNeededToStart 2" + "\n" + "sv.notEnoughPlayersRestartDelay 15" + "\n" + "sv.startDelay 15" + "\n" + "sv.endDelay 15"
                    + "\n" + "sv.spawnTime 8" + "\n" + "sv.manDownTime 8" + "\n" + "sv.endOfRoundDelay 15" + "\n" + "sv.ticketRatio 980" + "\n" + "sv.roundsPerMap 1" + "\n" + "sv.timeLimit 2700"
                    + "\n" + "sv.scoreLimit 0" + "\n" + "sv.soldierFriendlyFire 0" + "\n" + "sv.vehicleFriendlyFire 0" + "\n" + "sv.soldierSplashFriendlyFire 0" + "\n" + "sv.vehicleSplashFriendlyFire 0"
                    + "\n" + "sv.tkPunishEnabled 1" + "\n" + "sv.tkNumPunishToKick 3" + "\n" + "sv.tkPunishByDefault 0" + "\n" + "sv.votingEnabled 1" + "\n" + "sv.voteTime 90"
                    + "\n" + "sv.minPlayersForVoting 2" + "\n" + "sv.gameSpyPort 29900" + "\n" + "sv.allowNATNegotiation 0" + "\n" + "sv.interfaceIP \"0.0.0.0\"" + "\n" + "sv.autoRecord 0"
                    + "\n" + "sv.demoIndexURL http://" + "\n" + "sv.demoDownloadURL http://" + "\n" + "sv.autoDemoHook \"adminutils/demo/rotate_demo.exe\"" + "\n" + "sv.demoQuality 1"
                    + "\n" + "sv.adminScript \"modmanager\"" + "\n" + "sv.timeBeforeRestartMap 30" + "\n" + "sv.autoBalanceTeam 1" + "\n" + "sv.teamRatioPercent 100" + "\n" + "sv.voipEnabled 1"
                    + "\n" + "sv.voipQuality 3" + "\n" + "sv.voipServerRemote 0" + "\n" + "sv.voipServerRemoteIP \"\"" + "\n" + "sv.voipServerPort 55125" + "\n" + "sv.voipBFClientPort 55123"
                    + "\n" + "sv.voipBFServerPort 55124" + "\n" + "sv.voipSharedPassword \"\"" + "\n" + "sv.useGlobalRank 1" + "\n" + "sv.useGlobalUnlocks 1" + "\n" + "sv.sponsorText \"\""
                    + "\n" + "sv.sponsorLogoURL \"http://bf2.ttitt.net/logo.jpg\"" + "\n" + "sv.communityLogoURL \"http://bf2.ttitt.net/logo.jpg\"" + "\n" + "sv.radioSpamInterval 6"
                    + "\n" + "sv.radioMaxSpamFlagCount 6" + "\n" + "sv.radioBlockedDurationTime 30" + "\n" + "sv.numReservedSlots 0" + "\n" + "sv.friendlyFireWithMines 0" + "\n" + "sv.coopBotCount 16"
                    + "\n" + "sv.coopBotDifficulty 50" + "\n" + "sv.coopBotRatio 50" + "\n" + "sv.teamVoteOnly 0" + "\n" + "sv.noVehicles 1");//所有的功能已经写入
                sw.Close();//关闭流，才能写入文本
                MessageBox.Show("恢复成功");
                this.Close();
            }
            else
            {
                Close();
            }


        }

        //用于重载
        //        string ServerName = this.ServerNameBox.Text;
        //StreamWriter sw = new StreamWriter(@"mods\bf2\Settings\ServerSettings.con");//写入服务器设置文件
        //sw.WriteLine("sv.serverName " + ServerName + "\n" + "sv.password \"\"" + "\n" + "sv.internet 1"+"\n"+"sv.serverIP \"0.0.0.0\""+"\n"+"sv.serverPort "+ServerPortBox.Value
        //    +"\n"+"sv.welcomeMessage "+ServerWelcomeBox.Text +"\n"+"sv.punkBuster 1"+"\n"+"sv.allowFreeCam 1"+"\n"+"sv.allowExternalViews 1"+"\n"+"sv.allowNoseCam 1"+"\n"+"sv.hitIndicator 1"
        //    +"\n"+"sv.maxPlayers 40"+"\n"+"sv.numPlayersNeededToStart "+PlayersToStartValueBox.Text +"\n"+"sv.notEnoughPlayersRestartDelay 15"+"\n"+"sv.startDelay 15"+"\n"+"sv.endDelay 15"
        //    +"\n"+"sv.spawnTime 8"+"\n"+"sv.manDownTime 8"+"\n"+"sv.endOfRoundDelay 15"+"\n"+"sv.ticketRatio 980"+"\n"+"sv.roundsPerMap 1"+"\n"+"sv.timeLimit 2700"
        //    +"\n"+"sv.scoreLimit 0"+"\n"+"sv.soldierFriendlyFire 0"+"\n"+"sv.vehicleFriendlyFire 0"+"\n"+"sv.soldierSplashFriendlyFire 0"+"\n"+"sv.vehicleSplashFriendlyFire 0"
        //    +"\n"+"sv.tkPunishEnabled 1"+"\n"+"sv.tkNumPunishToKick 3"+"\n"+"sv.tkPunishByDefault 0"+"\n"+"sv.votingEnabled 1"+"\n"+"sv.voteTime 90"
        //    +"\n"+"sv.minPlayersForVoting 2"+"\n"+"sv.gameSpyPort 29900"+"\n"+"sv.allowNATNegotiation 0"+"\n"+"sv.interfaceIP \"0.0.0.0\""+"\n"+"sv.autoRecord 0"
        //    +"\n"+"sv.demoIndexURL http://"+"\n"+"sv.demoDownloadURL http://"+"\n"+"sv.autoDemoHook \"adminutils/demo/rotate_demo.exe\""+"\n"+"sv.demoQuality 1"
        //    +"\n"+"sv.adminScript \"modmanager\""+"\n"+"sv.timeBeforeRestartMap 30"+"\n"+"sv.autoBalanceTeam 1"+"\n"+"sv.teamRatioPercent 100"+"\n"+"sv.voipEnabled 1"
        //    +"\n"+"sv.voipQuality 3"+"\n"+"sv.voipServerRemote 0"+"\n"+"sv.voipServerRemoteIP \"\""+"\n"+"sv.voipServerPort 55125"+"\n"+"sv.voipBFClientPort 55123"
        //    +"\n"+"sv.voipBFServerPort 55124"+"\n"+"sv.voipSharedPassword \"\""+"\n"+"sv.useGlobalRank 1"+"\n"+"sv.useGlobalUnlocks 1"+"\n"+"sv.sponsorText \"\""
        //    +"\n"+"sv.sponsorLogoURL \"http://bf2.ttitt.net/logo.jpg\""+"\n"+"sv.communityLogoURL \"http://bf2.ttitt.net/logo.jpg\""+"\n"+"sv.radioSpamInterval 6"
        //    +"\n"+"sv.radioMaxSpamFlagCount 6"+"\n"+"sv.radioBlockedDurationTime 30"+"\n"+"sv.numReservedSlots 0"+"\n"+"sv.friendlyFireWithMines 0"+"\n"+"sv.coopBotCount 16"
        //    +"\n"+"sv.coopBotDifficulty 50"+"\n"+"sv.coopBotRatio 50"+"\n"+"sv.teamVoteOnly 0"+"\n"+"sv.noVehicles 1");//所有的功能已经写入
    }
}
